package com.zb.frame;

import com.zb.frame.base.upgrade.common.RepositoryUpgradeHelper;
import com.zb.frame.base.utils.DBUtil;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.stereotype.Component;

@Component
public class UpgradeApplication implements ApplicationRunner {


    @Override
    public void run(ApplicationArguments args) throws Exception {
        //init JDBC Connection Pool
        DBUtil.initPool();
        //upgrade init
        RepositoryUpgradeHelper.init();
        //upgrade task
        RepositoryUpgradeHelper.upgradeRepository();
    }
}
